#!/bin/bash

echo
echo "============================================"
echo "miniconda install   : install.sh"
echo "python_versions     : ${PYTHON_VERSIONS}"
echo "============================================"

IFS=',' read -r -a versions <<< "$PYTHON_VERSIONS"

# 遍历数组
for version in "${versions[@]}"; do
   echo "---------- create python$version ----------"
   if conda env list | grep -q "python$version"; then
        echo "conda python$version already exists"
    else
        conda create --name="python$version" python=$version -y
    fi
done